package com.hu.flink12.sensor

import org.apache.flink.streaming.api.scala._


/**
 * @Author: hujianjun
 * @Create Date: 2021/1/26 16:01
 * @Describe: 从csv文件读取数据，模拟滚动窗口函数
 */

object TimeWindowSensor2 {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment


    val inputSocketStream = env.socketTextStream("localhost", 7777)

    val value = inputSocketStream.map(data => {
      val strings = data.split(" ")
      for (i <- 0 until  strings.length) {
        println(strings(i))
      }
    })

    env.execute()
  }
}


